Libgdx change color of Texture at runtime [on hold]
Posted
by
Springrbua
on Game Development
See other posts from Game Development
or by Springrbua
Published on 2014-06-12T12:53:56Z
Indexed on
2014/06/12
15:43 UTC
Read the original article
Hit count: 188
i allready asked this on Stackoverflow
, but i think this question may belong here.
In a Libgdx game i have some Animation
s for my Player
. All the Frame
s for this Animation
are inside a TextureAtlas
.
The Player
Texture
s show a human, with a white T-Shirt. The T-Shirt is the only white part of the Player
.
Now i want to be able to replace the white color with red for Player
1, with green for Player
2 and so on.
How can i do that, without loosing the advantage of the TextureAtlas
(Texture
switching)?
Ofc 1 way would be to store 4 versions of every Frame
, for 4 different Players
(colors).
But there are games out there, where you can fully customize the Player
, give him a blue hat, red pants and pink shirts and so on. How can this be done?
Thanks a lot!
EDIT: The question on Stackoverflow
© Game Development or respective owner